<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/defaultconf.mex');

include($GLOBALS['LNG'].$_SESSION[$SESSLG]."/main.settings.php");
include($GLOBALS['LNG'].$_SESSION[$SESSLG]."/mod.clients.php");


MYTCONN();

$user = $GLOBALS['MYT']->db_array("SELECT name, staffmember FROM systemoffice.main_users where ref = {$_SESSION[$SESSID]} ");

$staff_member = $user[1]['staffmember'];

//echo $staff_member;

$userMail = $GLOBALS['MYT']->db_array("SELECT * FROM systemoffice.staff_members where smb_ID = '{$staff_member}' ");
$userMail2 = $userMail[1]['smb_CttEmail'];

//echo $userMail2;

$loja = $GLOBALS['MYT']->db_array("SELECT name FROM systemoffice.main_offices where ref = {$_SESSION[$SESSOF]} ");

$data = date("Y-m-d H:i:s");
$estado = "Aberto";
$user2 = $user[1]['name'];
$loja2 = $loja[1]['name'];
 
 
$equipamento_1_1 = $_POST['equipamento_1_1'];
$equipamento_1_2 = $_POST['equipamento_1_2'];

$impressora_1_1 = $_POST['impressora_1_1'];
$impressora_1_2 = $_POST['impressora_1_2'];
$impressora_1_3 = $_POST['impressora_1_3'];
$impressora_1_4 = $_POST['impressora_1_4'];
$impressora_1_5 = $_POST['impressora_1_5'];
$impressora_1_6 = $_POST['impressora_1_6'];
$impressora_1_7 = $_POST['impressora_1_7'];
$impressora_1_8 = $_POST['impressora_1_8'];
$impressora_1_9 = $_POST['impressora_1_9'];

$software_1_1 = $_POST['software_1_1'];
$software_1_2 = $_POST['software_1_2'];
$software_1_3 = $_POST['software_1_3'];
$software_1_4 = $_POST['software_1_4'];
$software_1_5 = $_POST['software_1_5'];
$software_1_6 = $_POST['software_1_6'];
$software_1_7 = $_POST['software_1_7'];
$software_1_8 = $_POST['software_1_8'];

$telefonia_1_1 = $_POST['telefonia_1_1'];
$telefonia_1_2 = $_POST['telefonia_1_2'];
$telefonia_1_3 = $_POST['telefonia_1_3'];
$telefonia_1_4 = $_POST['telefonia_1_4'];

$obs = $_POST['obs'];

WEBCONN();
$data = date("Y-m-d H:i:s");
if($GLOBALS['WEB']->db_query("INSERT into inquerito_informatica (Nome,Loja, data, Equipamentos_1_1, Equipamentos_1_2,Impressora_1_1, Impressora_1_2,
Impressora_1_3, Impressora_1_4, Impressora_1_5, Impressora_1_6, Impressora_1_7, Impressora_1_8, Impressora_1_9, Software_1_1,
Software_1_2, Software_1_3, Software_1_4, Software_1_5, Software_1_6, Software_1_7, Software_1_8,
Telefonia_1_1, Telefonia_1_2, Telefonia_1_3, Telefonia_1_4, obs) VALUES 
('$user2', '$loja2', '$data','$equipamento_1_1','$equipamento_1_2', '$impressora_1_1','$impressora_1_2','$impressora_1_3','$impressora_1_4',
'$impressora_1_5', '$impressora_1_6', '$impressora_1_7', '$impressora_1_8' ,'$impressora_1_9',
 '$software_1_1','$software_1_2','$software_1_3', '$software_1_4','$software_1_5','$software_1_6','$software_1_7', '$software_1_8',
 '$telefonia_1_1', '$telefonia_1_2', '$telefonia_1_3',  '$telefonia_1_4', '$obs') ")){
echo '<div class="Confirm">Inquerito Guardado</div>';
}else{
    echo 'Problema de ligacao.';
}
	
?>